package com.lyl.momanapp.adapter;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;

import com.lyl.momanapp.R;
import com.lyl.momanapp.activity.OneActivity;

/**
 * 名字 梁亚龙
 * 时间 2017/10/17.
 * QQ邮箱 503934353@qq.com
 */

public class UserSeJi extends BaseAdapter {
    private LayoutInflater mInflater;
    private Context context;
    private String[] strings;
    public UserSeJi(Context context,String[] strings) {
        this.mInflater = LayoutInflater.from(context);
        this.strings=strings;
        this.context=context;
    }

    @Override
    public int getCount() {
        return strings.length;
    }

    @Override
    public Object getItem(int position) {
        return strings[position];
    }

    @Override
    public long getItemId(int position) {
        return position;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        View inflate = mInflater.inflate(R.layout.item_user_seji, null);
        inflate.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(context, OneActivity.class);
                Bundle bundle=new Bundle();
                //传递name参数为tinyphp
                bundle.putString("tag", "OK");
                intent.putExtras(bundle);
                context.startActivity(intent);
            }
        });
        return   inflate;
    }
}
